<?php

/**
 * Factura form base class.
 *
 * @method Factura getObject() Returns the current form's model object
 *
 * @package    aeropostal
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseFacturaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'numero'     => new sfWidgetFormInputHidden(),
      'numControl' => new sfWidgetFormInputText(),
      'fecha'      => new sfWidgetFormDate(),
      'proveedor'  => new sfWidgetFormInputHidden(),
      'fechaTrans' => new sfWidgetFormDate(),
      'numTrans'   => new sfWidgetFormInputText(),
      'moneda'     => new sfWidgetFormPropelChoice(array('model' => 'Moneda', 'add_empty' => false)),
      'uMedida'    => new sfWidgetFormPropelChoice(array('model' => 'Unidmedida', 'add_empty' => false)),
      'estacion'   => new sfWidgetFormPropelChoice(array('model' => 'Estacion', 'add_empty' => false)),
      'empresa'    => new sfWidgetFormPropelChoice(array('model' => 'Compania', 'add_empty' => false)),
      'transmitir' => new sfWidgetFormInputCheckbox(),
      'reclamo'    => new sfWidgetFormInputCheckbox(),
      'cantTotal'  => new sfWidgetFormInputText(),
      'total'      => new sfWidgetFormInputText(),
      'estatus'    => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'numero'     => new sfValidatorChoice(array('choices' => array($this->getObject()->getNumero()), 'empty_value' => $this->getObject()->getNumero(), 'required' => false)),
      'numControl' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'fecha'      => new sfValidatorDate(),
      'proveedor'  => new sfValidatorPropelChoice(array('model' => 'Proveedor', 'column' => 'rif', 'required' => false)),
      'fechaTrans' => new sfValidatorDate(array('required' => false)),
      'numTrans'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'moneda'     => new sfValidatorPropelChoice(array('model' => 'Moneda', 'column' => 'id')),
      'uMedida'    => new sfValidatorPropelChoice(array('model' => 'Unidmedida', 'column' => 'simbolo')),
      'estacion'   => new sfValidatorPropelChoice(array('model' => 'Estacion', 'column' => 'codigo')),
      'empresa'    => new sfValidatorPropelChoice(array('model' => 'Compania', 'column' => 'id')),
      'transmitir' => new sfValidatorBoolean(),
      'reclamo'    => new sfValidatorBoolean(),
      'cantTotal'  => new sfValidatorNumber(),
      'total'      => new sfValidatorNumber(),
      'estatus'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('factura[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Factura';
  }


}
